#!/bin/bash

usage()
{
cat << EOF
Usage: $0 [OPTION]... <recording name> <duration>

This script queues a recording for the vlbistreamer daemon
EOF
}
#Both should update at installed location after make install
SCRIPTNAME=vbs_record
scriptPath=${0%$SCRIPTNAME}
if [ -z "$scriptPath" ]
then
  #invoked from PATH
  scriptPath=$(which $0)
  scriptPath=${scriptPath%$SCRIPTNAME}
fi
source ${scriptPath}vbs_common_functions

vbs_queue $@ -m r

if [ $? == 1 ]
then
  echo ""
  usage
  echo ""
  echo $(date --rfc-3339=seconds) "Errors in parameters of recording $RECNAME"
else
  echo "Recording added OK"
fi
exit 0
